﻿Imports System
Imports System.Security.Cryptography
Imports System.Text

Namespace System.Workflow.Runtime
    Friend Class HashHelper
        ' Methods
        Friend Shared Function HashServiceType(ByVal serviceFullTypeName As String) As Guid
            Dim md As MD5 = New MD5CryptoServiceProvider
            Dim bytes As Byte() = New UnicodeEncoding().GetBytes(serviceFullTypeName)
            Return New Guid(md.ComputeHash(bytes))
        End Function

        Friend Shared Function HashServiceType(ByVal serviceType As Type) As Guid
            Return HashHelper.HashServiceType(serviceType.AssemblyQualifiedName)
        End Function

    End Class
End Namespace

